package com.gl.common.utils;

import java.io.Serializable;

/**
 * <p>Description:JSON返回数组组装模型</p>
 *
 * @author gaol
 * @version 1.0
 * @date 2017/5/12
 */
public class Result implements Serializable {

    /**
     * 请求数据是否成功
     * true  是
     * false 否
     */
    public boolean success;

    /**
     * 返回码
     */
    public int code;

    /**
     * 信息说明
     */
    public String message;


    /**
     * 返回数据
     */
    public Object data;


    public Result() {
        this.success = true;
    }

    public Result(Object data) {
        this.setSuccess(true);
        this.data = data;
    }

    public Result(int code, String message) {
        this.setSuccess(false);
        this.code = code;
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
